package com.hmdp.enums;

import lombok.Getter;

/**
 * 统一错误码枚举
 *
 * @author leizi
 * @date 2024/02/01
 */
@Getter
public enum ErrorCodeEnum {

    SUCCESS(0, "成功"),

    /**************用户登录注册相关**************/
    USER_PHONE_FORMAT_FAIL(100001, "手机号格式不正确"),
    USER_CODE_NOT_EXISTS(100002, "验证码不能为空"),
    USER_CODE_LOST_EFFECTIVENESS(100003, "验证码已失效"),

    /**************商铺相关**************/
    SHOP_EMPTY(200001, "商铺不存在"),
    SHOP_ID_IS_NOT_NULL(200002, "商铺ID不能为空"),

    /**************优惠券相关**************/
    VOUCHER_NOT_START_TIME(300001,"抢购未开始，请等待..."),
    VOUCHER_NOT_END_TIME(300002,"优惠券抢购已结束"),
    VOUCHER_STOCK_EMPTY(300003,"优惠券已被强空，请下次抢购"),
    VOUCHER_SOLD_OUT(300004,"秒杀优惠券已下架"),
    VOUCHER_SOLD_RETRY(300005,"活动太火爆了，请重试..."),
    VOUCHER_SOLD_REPEAT(300006,"已经抢购到，不能重复抢购."),

    /**************达人探店相关**************/
    BLOG_NOT_FOUND(400001, "没有找到笔记"),
    BLOG_SAVE_FAIL(400002, "发布笔记失败"),
    ;


    private Integer code;

    private String msg;

    ErrorCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
